#!/usr/bin/perl

$senNum=1;
while($line=<STDIN>) {
	chomp($line);
	@words = split(/\s+/,$line);
	print "\n$senNum\n";
	foreach $word (@words) {
		print $word."\n";
	}
	$senNum++;
}
